package cn.scw.project.facility.mapper;

import cn.scw.project.facility.domain.FacPrintPriceFacility;
import cn.scw.project.facility.domain.netework.bean.FacPrintPriceFacilityFindReq;
import cn.scw.project.facility.domain.vo.FacPrintPriceVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

/**
 * 设备打印价格Mapper接口
 *
 * @author api
 * @date 2020-05-20
 */
public interface FacPrintPriceFacilityMapper {
    /**
     * 查询设备打印价格
     *
     * @param id 设备打印价格ID
     * @return 设备打印价格
     */
    public FacPrintPriceFacility selectFacPrintPriceFacilityById(Long id);

    FacPrintPriceVo selectFacPrintPriceFacilityVoById(Long id);


    /**
     * 查询设备打印价格列表
     *
     * @param code 设备编码
     * @return 设备打印价格集合
     */
    public List<FacPrintPriceVo> selectFacPrintPriceFacilityList(@Param("code") String code);

    /**
     * 新增设备打印价格
     *
     * @param facPrintPriceFacility 设备打印价格
     * @return 结果
     */
    public int insertFacPrintPriceFacility(FacPrintPriceFacility facPrintPriceFacility);

    /**
     * 修改设备打印价格
     *
     * @param facPrintPriceFacility 设备打印价格
     * @return 结果
     */
    public int updateFacPrintPriceFacility(FacPrintPriceFacility facPrintPriceFacility);

    /**
     * 删除设备打印价格
     *
     * @param id 设备打印价格ID
     * @return 结果
     */
    public int deleteFacPrintPriceFacilityById(Long id);

    /**
     * 批量删除设备打印价格
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteFacPrintPriceFacilityByIds(Long[] ids);

    boolean existsByCodeTypeAndIsColoursAndIsDoubleFacedAndPaperNumber(@Param("facilityCode") String facilityCode, @Param("type") String type, @Param("isColours") boolean isColours, @Param("isDoubleFaced") boolean isDoubleFaced, @Param("paperNumber") int paperNumber);

    FacPrintPriceVo selectByFacilityCodeAndTypeAndIsColoursAndIsDoubleFacedAndPaperNumber(@Param("facilityCode") String facilityCode, @Param("type") String type, @Param("isColours") boolean isColours, @Param("isDoubleFaced") boolean isDoubleFaced, @Param("paperNumber") int paperNumber);

    FacPrintPriceVo findByCodeAndTypeAndPaperNumber(FacPrintPriceFacilityFindReq req);
}
